//
//  KAMeHeaderView.m
//  KeepAccounts
//
//  Created by honeyrr on 2017/10/29.
//  Copyright © 2017年 honeyrr. All rights reserved.
//

#import "KAMeHeaderView.h"
@interface KAMeHeaderView()

@property (weak, nonatomic) IBOutlet UILabel *userName;

@end

@implementation KAMeHeaderView

-(void)setName:(NSString *)name
{
    _name =  name;
    _userName.text = name;
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self = [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([KAMeHeaderView class]) owner:nil options:nil] lastObject];
        self.userName.text = [[NSUserDefaults standardUserDefaults] valueForKey:@"userName"];
    }
    return self;
}


- (IBAction)msgBtn:(id)sender {
    if ([self.delegate respondsToSelector:@selector(headerMsgBtnClick:)]) {
        [self.delegate headerMsgBtnClick:self];
    }
}
- (IBAction)iconBtn:(id)sender {
    if ([self.delegate respondsToSelector:@selector(headerIconBtnClick:)]) {
        [self.delegate headerIconBtnClick:self.userName];
    }
}

@end
